<?php
class Exts_Views_Helpers_Flashmessages extends Zend_View_Helper_Abstract {

	public function flashmessages() {
		$messages = Zend_Controller_Action_HelperBroker::
			getStaticHelper('FlashMessenger')
			->getMessages();
		if( !isset( $messages['error'] )){
			return NULL;
		}
		$out = '<ul id="messages">';
		foreach( $messages['error'] as $m ) {
			$out .= '<li class="'.$m->type.'">' . $m->message . '</li>';

		}
		$out .= '</ul>';
		return $out;
	}
}
